package com.uperform.coach.tdd.infrastructure;

import com.uperform.coach.tdd.domain.Task;
import com.uperform.coach.tdd.domain.TaskRepository;
import org.springframework.stereotype.Component;

@Component
public class TaskRepositoryImpl implements TaskRepository {
    private final TaskDAO taskDAO;

    public TaskRepositoryImpl(TaskDAO taskDAO) {
        this.taskDAO = taskDAO;
    }

    @Override
    public void save(Task task) {
        taskDAO.save(TaskDO.fromEntity(task));
    }
}
